<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@page import="com.xea.service.ServiceFactory"%>
<%@page import="com.xea.service.InformationService"%>
<%@page import="com.xea.model.Information"%>
<%@page import="com.xea.util.StringUtil"%>
<%@page import="com.uf.util.PageData"%>
<%@include file="../../inner/head.jsp"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<link type="text/css" rel="stylesheet" href="${basepath}/res/images/style.css" />
<div id="list_r">
	<div style="margin:0px 30px 100px 30px;border:1px solid #aeaeae;">
		<div style="line-height:48px;font-size:22px;font-weight: bold;font-family: '黑体';text-align: left;margin-left: 5px;background:url('${basepath}/res/images/information.png') no-repeat;" ><b style="margin-left: 70px">Information Center</b></div>
		<div style="line-height:48px;text-align: left;margin-left: 30px;">
			<table width="100%" border="0" cellpadding="0" cellspacing="1">
				<%
					InformationService informationDao = ServiceFactory.getInformationService();
					String pageNo=request.getParameter("p");
					if(StringUtil.isNullOrEmpty(pageNo) || "0".equals(pageNo))
						pageNo="1";
					PageData pagedata =informationDao.searchforout(pageNo); 
					List nlist = pagedata.getData();
					int cP = pagedata.getCurrentPage();
					int tP = pagedata.getTotalPage();
					int pre = cP-1<1?1:cP-1; 
					int next = cP+1>tP?tP:cP+1;
					for(int i=0;i<nlist.size();i++){
						Information information = (Information)nlist.get(i);
						if(information.getTitle().length() >=80)
							information.setTitle(information.getTitle().substring(0,80)+"...");
				 %>	
				<tr>
					<td width="13" height="24" align="left">
						<img src="${basepath}/res/image/trt_poi.gif" height="4" width="5" complete="complete"> 
					</td>
					<td width="540px">
						<a target="_blank" href="${basepath}/outer/infordetail.jsp?id=<%=information.getId() %>" style="color: #4a4a4a;font-size: 14px;">
							<%=information.getTitle() %>
						</a>
					</td>
					<td>
						(<%=information.getCreateDate() %>)
					</td>
				</tr>
				<%
					}
				
				%>
			</table>
		</div>
		<div class="pagination" style="font-weight: normal;">
			<table width="100%" border="0" align="right" cellpadding="0" cellspacing="0">
				<tr>
					<td align="right" style="cursor: pointer;font-weight: bold;" >
						<%
							if(pagedata.getTotalPage() >1){
						%>
						<a href="${basepath}/outer/information.jsp?p=1" style="color:#89140e;padding: 3px;"/>&lt;&lt;</a>
						<a href="${basepath}/outer/information.jsp?p=<%=pre%>" title="Previous" style="color:#89140e;padding: 3px;"/>Previous</a>
						<%
							for(int i=0;i<pagedata.getTotalPage();i++){	
						%>
					    <a id="st<%=i+1%>" href="${basepath}/outer/information.jsp?p=<%=i+1 %>" style="color:#89140e;padding: 3px;"><%=i+1 %></a>
					    <%}%>
						<a href="${basepath}/outer/information.jsp?p=<%=next%>" title="Next" style="color:#89140e;padding: 3px;">Next</a>
						<a href="${basepath}/outer/information.jsp?p=<%=pagedata.getTotalPage()%>" style="color:#89140e;padding: 3px;"/>&gt;&gt;</a>
					</td>
					<td width="40">&nbsp;</td>
					<%} %>
					<script>
					if(<%=pagedata.getTotalPage()%>>1){
						$("#st"+<%=pagedata.getCurrentPage()%>).css("font-weight", "bold"); 
						$("#st"+<%=pagedata.getCurrentPage()%>).css("font-size", "16px"); 
					}
					</script>
				</tr>
				<input id="pageNo" name="pageNo" type="hidden" value="<%=pagedata.getCurrentPage() %>"/>
			</table>
			&nbsp;
			<br/>
		</div>
	</div>
</div>
</body>
